package com.tbh.ioc.container.applicationContext;

import com.tbh.ioc.bean.HelloWorld;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class ApplicationContextMain {
    public static void main(String[] args) {
        // 获取xml配置的bean
//        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("Beans.xml");
        ApplicationContext applicationContext = new FileSystemXmlApplicationContext("E:\\workspace\\java\\spring\\spring-framework\\spring-framework-ioc\\src\\main\\resources\\Beans.xml");
        HelloWorld helloWorld = (HelloWorld) applicationContext.getBean("helloWorld");
        helloWorld.setMessage("FileSystemXmlApplicationContext getBean");
        String message = helloWorld.getMessage();
        System.out.println(message);
    }
}
